<!--
 * @Description: 
 * @version: 
 * @Author: yyconion
 * @Date: 2021-07-23 09:41:59
 * @LastEditors: yyconion
 * @LastEditTime: 2021-11-16 13:34:13
-->
<template>
  <div class="aside-menu">

    <el-menu default-active="1"
             class="el-menu-vertical-demo"
             background-color="#11002d"
             text-color="#fff"
             active-text-color="#ffd04b"
             @open="handleOpen"
             @close="handleClose"
             :collapse="isCollapse">
      <el-menu-item @click="menuitemclick(item.index)"
                    v-for="item in menuItem"
                    :key="item.index"
                    :index="item.index">
        <template #title>{{item.title}}</template>
      </el-menu-item>
    </el-menu>
  </div>

</template>

<script>
export default {
  name: 'homeAside',
  props: ['isInSchool'],
  emits: ['changeIsInSchool'],
  data () {
    return {
      // 菜单是否折叠
      isCollapse: false,
      // 菜单列表
      menuItem: [{
        index: 1,
        title: '学生概况',

      }, {
        index: 2,
        title: '学生详细信息',

      }]
    }
  }, methods: {
    // 发送信息给首页，更新isInSchool标志
    menuitemclick (index) {
      this.$emit("changeIsInSchool", index)
    }
  }
}
</script>

<style lang='less' scoped>
* {
  text-align: left;
}
.el-menu {
  border: 0px !important;
}
.aside-menu {
  padding-top: 0.25rem;
  overflow: hidden;
  height: 100%;
  width: inherit !important;
  .switchmenu {
    background-color: black;
    height: 3.7rem;
    line-height: 3.7rem;
    text-align: center;
    color: white;
    width: inherit !important;
  }
}
.is-active {
  color: white !important;
  background: linear-gradient(to right, #25b9c3, #3f9eb6);
  border-right: 0.2rem solid #e5e5e5 !important;
}
.el-menu {
  border-right: 0.05rem solid #e5e5e5;
  height: 100%;
  li {
    height: 3.7rem;
    line-height: 3.7rem;
    font-size: 1rem;
  }
}
</style>